﻿@{
     var custList = CustomerManager.GetAllCustomers();
     foreach(var cust in custList){
         //update CustomerRegion
         var custRegion = RefDataManager.GetCountryRegion(cust.Country);
         if(custRegion!=null){
             //update CustomerRegion field
             string sql = String.Format("UPDATE Customer SET CustomerRegion='{0}' WHERE CustomerID='{1}'",custRegion.ParentRefID,cust.CustomerID);
             DBManager.Execute(sql,null);
         }
         
     }   
      
}


